using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.Xml;

namespace XmlBastardiser
{
    public partial class BastardiserMainForm : Form
    {
        public BastardiserMainForm ()
        {
            InitializeComponent ();

            chkInputWrap.Checked = txtInput.WordWrap;
            chkOutputWrap.Checked = txtOutput.WordWrap;
        }

        private void btnFlatten_Click (object sender, EventArgs e)
        {
            XmlDocument flattenedInput = new XmlDocument ();
            flattenedInput.LoadXml (txtInput.Text);

            txtOutput.Clear ();
            txtOutput.Text = flattenedInput.OuterXml;
        }

        private void chkInputWrap_CheckedChanged (object sender, EventArgs e)
        {
            txtInput.WordWrap = chkInputWrap.Checked;
        }

        private void chkOutputWrap_CheckedChanged (object sender, EventArgs e)
        {
            txtOutput.WordWrap = chkOutputWrap.Checked;
        }
    }
}